<template>
<div>
    <div class="title">
        <p class="renyuan">基本信息</p>
    </div>
    <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" class="sosuo2_6" >
    <div  style="padding-left: 30px;padding-bottom: 20px;border-bottom: 1px solid #dbe3f3;">
        <Form-item class="sost4" prop="orgName">
            <p class="tit">名称：</p>
            <Input v-model="formValidate.orgName" :disabled='disabled' size="large" placeholder="未编辑" @on-blur="checkname(1,$event)" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4" prop="orgCode">
            <p class="tit">三证合一编码：(提交后不可更改)</p>
            <Input v-model="formValidate.orgCode" :disabled='disabled_orgcode' size="large" placeholder="未编辑" @on-blur="checkname(2,$event)" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4" prop="lawPerson">
            <p class="tit">法人代表：</p>
            <Input v-model="formValidate.lawPerson" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4" prop="establishTime">
            <p class="tit">成立日期：</p>
            <Date-picker type="date" placeholder="选择日期" :disabled='disabled'  v-model="formValidate.establishTime" style="width:280px;font-size: 14px"></Date-picker>
        </Form-item>
        <Form-item class="sost4" prop="regiestCapital">
            <p class="tit">注册资金：</p>
            <Input v-model="formValidate.regiestCapital" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4" prop="postCode">
            <p class="tit">邮编：</p>
            <Input v-model="formValidate.postCode" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
    </div>
    <div class="title_5">
        <p class="renyuan">联系人</p>
    </div>
    <div style="padding:20px 0px 20px 30px;border-bottom: 1px solid #dbe3f3;">
        <Form-item class="sost4" prop="contact">
            <p class="tit">联系人：</p>
            <Input v-model="formValidate.contact" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4" prop="orgContactormobile">
            <p class="tit">联系人电话：</p>
            <Input v-model="formValidate.orgContactormobile" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4">
            
        </Form-item>
        <Form-item class="sost4" prop="address" style="width:603px;margin-bottom: 10px;">
            <p class="tit">通讯地址：</p>
            <Input v-model="formValidate.address" :disabled='disabled' type="textarea" :autosize="{minRows: 3,maxRows: 10}" placeholder="未编辑"></Input>
        </Form-item>
    </div>
    <div class="title_5">
        <p class="renyuan">资金账户</p>
    </div>
    <div  style="padding: 20px 0px 20px 30px;border-bottom: 1px solid #dbe3f3;">
        <Form-item class="sost4" prop="depositAccount">
            <p class="tit">保证金账户：</p>
            <Input v-model="formValidate.depositAccount" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4" prop="depositBank">
            <p class="tit">保证金银行：</p>
            <Select v-model="formValidate.depositBank" clearable class="selc" :disabled='disabled' style="width:280px;font-size: 14px" placeholder="未选择">
                <Option v-for="item in bank" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
        </Form-item>
        <Form-item class="sost4" prop="depositAmount">
            <p class="tit">保证金总额：</p>
            <Input v-model="formValidate.depositAmount" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4" prop="drawAccount">
            <p class="tit">扣款账户：</p>
            <Input v-model="formValidate.drawAccount" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4" prop="drawBank">
            <p class="tit">扣款银行：</p>
            <Select v-model="formValidate.drawBank" clearable class="selc" :disabled='disabled' style="width:280px;font-size: 14px" placeholder="未选择">
                <Option v-for="item in bank" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
        </Form-item>
        <Form-item class="sost4">
            
        </Form-item>
        <Form-item class="sost4" prop="saveAccount">
            <p class="tit">存款账户：</p>
            <Input v-model="formValidate.saveAccount" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4" prop="saveBank">
            <p class="tit">存款银行：</p>
            <Select v-model="formValidate.saveBank" :disabled='disabled' clearable class="selc" style="width:280px;font-size: 14px" placeholder="未选择">
                <Option v-for="item in bank" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
        </Form-item>
    </div>
    <div class="title_5">
        <p class="renyuan">账户信息</p>
    </div>
    <div style="padding: 20px 0px 20px 30px;border-bottom: 1px solid #dbe3f3;">
        <Form-item class="sost4" prop="userName">
            <p class="tit">用户名：</p>
            <Input v-model="formValidate.userName" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4" prop="userPwd">
            <p class="tit">密码：</p>
            <Input v-model="formValidate.userPwd" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4">
            
        </Form-item>
        <Form-item class="sost4" prop="orgUsermobile">
            <p class="tit">手机号：</p>
            <Input v-model="formValidate.orgUsermobile" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4" prop="email">
            <p class="tit">邮箱：</p>
            <Input v-model="formValidate.email" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4">
            
        </Form-item>
        <Form-item class="sost4" prop="maxTenantNo" style="float: left;">
            <p class="tit">租户最大用户数：</p>
            <Input v-model="formValidate.maxTenantNo" :disabled='disabled' size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item prop="status" style="float: left;padding-left: 5px;">
            <p class="tit" style="padding-bottom: 2px;">是否有效：</p>
            <Radio-group  v-model="formValidate.status" type="button">    
                <Radio class="ridou" label="1" :disabled='disabled'>
                    <span>是</span>
                </Radio>
                <Radio class="ridou" label="0" :disabled='disabled'>
                    <span>否</span>
                </Radio>
            </Radio-group>
        </Form-item>
    </div>
    <div class="title_5">
        <p class="renyuan">合约信息</p>
    </div>

    <div class="sosuo2" style="height:125px;width: 100%;">
        <Form-item class="sost4" prop="deductRate">
            <p class="tit">合约利率(%)：</p>
            <Input v-model="formValidate.deductRate" :disabled='disabled'  size="large" placeholder="未编辑" style="width:280px;font-size: 14px"></Input>
        </Form-item>
        <Form-item class="sost4" prop="contractStartDate">
            <p class="tit">合约开始日期：</p>
            <Date-picker type="date" placeholder="选择日期" :disabled='disabled' v-model="formValidate.contractStartDate" style="width:280px;font-size: 14px"></Date-picker>
        </Form-item>
        <Form-item class="sost4" prop="contractEndDate">
            <p class="tit">合约结束日期：</p>
            <Date-picker type="date" placeholder="选择日期" :disabled='disabled' v-model="formValidate.contractEndDate" style="width:280px;font-size: 14px"></Date-picker>
        </Form-item>
    </div>
    </Form>
    <div class="title_5">
        <p class="renyuan">附件信息</p>
    </div>
    <div class="tab">
        <p class="tit" style="margin-top:-10px;font-size: 14px;height: 25px;">附件：</p>    
        <div class="uptab">
            <span class="uptabc" style="width: 180px;">序号</span>
            <span class="uptabc" style="width: 240px;">描述</span>
            <span class="uptabc" style="width: 300px;">文件名称</span>
            <span class="uptabc">操作</span>
        </div>
        <div class="uptab1">
            <span class="uptabc" style="width: 168px;padding-left: 10px;">1</span>
            <span class="uptabc" style="width: 112px;">营业执照</span>
            <div class="uptabc" style="width: 330px;text-align: center;overflow: hidden;">
                <span>{{this.up1}}</span>
                <template v-for="item in uploadList">
                        <Progress v-if="item.showProgress"  :percent="item.percentage"  style="width: 150px;"></Progress>
                </template>
            </div>
            <div class="uptabc" style="margin-top: -6px;margin-left: 25px;">
                <Upload style="width:60px;margin-left: 10px;display: inline-block;padding: 6px 0px;"
                ref="upload" 
                :action="postUrl1" 
                name="businessLicense" 
                :format="['jpg','jpeg','png']" 
                :max-size="2000" 
                :show-upload-list=false
                :before-upload="handleBeforeUpload"
                :on-success="handleSuccess" 
                :on-format-error="handleFormatError" 
                :on-exceeded-size="handleMaxSize">
                    <Button type="text" style="color:#5b8cff;font-size: 14px;" :disabled="disabled1">上传</Button>
                </Upload>
                <Button type="text" style="color:#5b8cff;font-size: 14px;padding: 6px 10px;" :disabled="disabled4" @click="handleView()">查看</Button>
                <Button type="text" style="color:#f7805f;font-size: 14px;padding: 6px 10px;" @click="remove_zc(ID,1)" :disabled="disabled4">删除</Button>
            </div>
        </div>
        <div class="uptab1" style="background: #fafcff;">
            <span class="uptabc" style="width: 168px;padding-left: 10px;">2</span>
            <span class="uptabc" style="width: 112px;">合约信息</span>
            <div class="uptabc" style="width: 330px;text-align: center;overflow: hidden;">
                <span>{{this.up2}}</span>
                <template v-for="item in uploadList1">
                        <Progress v-if="item.showProgress"  :percent="item.percentage"  style="width: 150px;"></Progress>
                </template>
            </div>
            <div class="uptabc" style="margin-top: -6px;margin-left: 25px;">
                <Upload style="width:60px;margin-left: 10px;display: inline-block;padding: 6px 0px;"
                ref="upload1" 
                :action="postUrl2" 
                name="contractInfo" 
                :format="['jpg','jpeg','png']" 
                :max-size="2000" 
                :show-upload-list=false
                :before-upload="handleBeforeUpload"
                :on-success="handleSuccess1" 
                :on-format-error="handleFormatError" 
                :on-exceeded-size="handleMaxSize">
                    <Button type="text" style="color:#5b8cff;font-size: 14px;" :disabled="disabled2">上传</Button>
                </Upload>
                <Button type="text" style="color:#5b8cff;font-size: 14px;padding: 6px 10px;" :disabled="disabled5" @click="handleView()">查看</Button>
                <Button type="text" style="color:#f7805f;font-size: 14px;padding: 6px 10px;" @click="remove_zc(ID2,2)" :disabled="disabled5">删除</Button>
            </div>
        </div>
        <Modal title="查看图片" v-model="visible">
            <img :src="src" style="width: 100%">
        </Modal>
    </div>
    <div class="tijiao">
        <Button v-if='disabled' id="serch1_9"  type="primary" style="margin-right: 30px;"><router-link tag="p" class="hcgc"  to="/test4">确定</router-link></Button>
        <div v-else>
            <Button id="cancel1"  type="primary" style="margin-right: 30px;"><router-link tag="p" class="hcgc"  to="/test4">取消</router-link></Button>
            <Button  id="serch1_9"  @click="handleSubmit_zc('formValidate')" type="primary">保存</Button>
        </div>
    </div>
</div>   
</template>
<script>
    import Base from '../common/Base.js'
    import {
        mapGetters
    } from 'vuex'
    export default {
        mixins:[Base],
        data () {
            return {
                disabled_orgcode:false,
                disabled:false,
                src:'',
                list:[],
                disabled1:false,
                disabled2:false,
                disabled3:false,
                disabled4:true,
                disabled5:true,
                disabled6:true,
                visible: false,
                uploadList: [],
                uploadList1: [],
                uploadList2: [],
                up1:'— —',
                up2:'— —',
                up3:'— —',
                handleBeforeUpload(){

                },
                bank: [
                    {
                        value: '工商银行',
                        label: '工商银行'
                    },
                    {
                        value: '中国银行',
                        label: '中国银行'
                    },
                    {
                        value: '农业银行',
                        label: '农业银行'
                    },
                    {
                        value: '招商银行',
                        label: '招商银行'
                    }
                ],
                formValidate: {
                    createUser: "",           
                    deductRate: "",                     // 利率
                    contractStartDate: "",       // 起始日期
                    contractEndDate: "",          //  结束日期
                    depositAccount: "",              // 保证金账户
                    depositAmount: "",                // 保证金总额
                    depositBank: "",                  // 保证金银行
                    drawAccount: "",                  // 扣款账户
                    drawBank: "",                  // 扣款银行
                    saveAccount: "",                 // 存款账户
                    saveBank: "",                     // 存款银行
                    businessLicense:'',                      //营业执照
                    contractInfo:'',                         //合约
                    contact: "",                        // 联系人                
                    address: "",                  // 地址
                    orgContactormobile: "",                  // 电话
                    email: "",                 // 邮箱
                    orgUsermobile: "",                   // 手机号
                    userName: "",                    // 用户名
                    userPwd: "",                       // 密码
                    maxTenantNo: "",                   //  租户最大数
                    status: "1",                            //  是否生效            
                    establishTime: '',              // 成立日期
                    lawPerson: "",                      // 法人
                    orgCode: "",                       // 三证合一编号
                    orgName: "",                    // 名称
                    postCode: "",                    // 邮编
                    regiestCapital: "",                 // 注册资金
                    businessLicense:'',                      //营业执照
                    contractInfo:'',
                    assetDeduct_id:'',
                    assetPartner_assetId:'',
                    orgContactor_id:'',
                    orgUser_userId:'',
                    saTenant_tenantId:'',
                    organization_tenantId:''
                },
                formValidate1: {
                    assetDeduct: {              //  合约信息栏
                        createUser: "",           
                        deductRate: "",                     // 利率----------
                        contractStartDate: "",       // 起始日期
                        contractEndDate: "",          //  结束日期
                        id:''
                    },
                    assetPartner: {             //  资产账户栏
                        assetId:'',
                        createUser: "", 
                        depositAccount: "",              // 保证金账户
                        depositAmount: "",                // 保证金总额-------------------
                        depositBank: "",                  // 保证金银行
                        drawAccount: "",                  // 扣款账户
                        drawBank: "",                  // 扣款银行
                        saveAccount: "",                 // 存款账户
                        saveBank: "",                     // 存款银行
                        businessLicense:'',                      //营业执照
                        contractInfo:''                         //合约
                    },
                    orgContactor: {            // 联系人栏
                        id:'',
                        contact: "",                        // 联系人
                        createUser: "",                 
                        address: "",                  // 地址
                        mobile: ""                  // 电话
                    },
                    orgUser: {                 // 账户信息栏
                        createUser: "",
                        userId:'',
                        email: "",                 // 邮箱
                        mobile: "",                   // 手机号
                        userName: "",                    // 用户名
                        userPwd: ""                       // 密码
                    },
                    saTenant: {                //   租户栏
                        createUser: "", 
                        maxTenantNo: "",                   //  租户最大数------------------------
                        status: "1",                            //  是否生效 
                        tenantId:''
                    },
                    organization: {            //  基本信息
                        tenantId:'', 
                        createUser: '',           
                        establishTime: '',              // 成立日期
                        lawPerson: "",                      // 法人
                        orgCode: "",                       // 三证合一编号
                        orgName: "",                    // 名称
                        postCode: "",                    // 邮编
                        regiestCapital: ""                 // 注册资金--------------------
                    }
                },
                ruleValidate: {
                    regiestCapital: [
                        { required: true, message: '注册资金不能为空', trigger: 'blur' }
                    ],
                    deductRate:[
                        { required: true, message: '利率不能为空', trigger: 'blur' }
                    ],
                    contractStartDate:[
                        { required: true, type: 'date', message: '请选择起始日期', trigger: 'change' }
                    ],       // 起始日期
                    contractEndDate:[
                        { required: true, type: 'date', message: '请选择结束日期', trigger: 'change' }
                    ],          //  结束日期
                    depositAccount:[
                        { required: true, message: '保证金账户不能为空', trigger: 'blur' }
                    ],              // 保证金账户
                    depositAmount:[
                        { required: true, message: '保证金总额不能为空', trigger: 'blur' }
                    ],                // 保证金总额
                    depositBank:[
                        { required: true, message: '保证金银行不能为空', trigger: 'change' }
                    ],                  // 保证金银行
                    drawAccount:[
                        { required: true, message: '扣款账户不能为空', trigger: 'blur' }
                    ],                  // 扣款账户
                    drawBank:[
                        { required: true, message: '扣款银行不能为空', trigger: 'change' }
                    ],                  // 扣款银行
                    saveAccount:[
                        { required: true, message: '存款账户不能为空', trigger: 'blur' }
                    ],                 // 存款账户
                    saveBank:[
                        { required: true, message: '存款银行不能为空', trigger: 'change' }
                    ],                     // 存款银行
                    contact:[
                        { required: true, message: '联系人不能为空', trigger: 'blur' }
                    ],                        // 联系人                
                    address:[
                        { required: true, message: '地址不能为空', trigger: 'blur' }
                    ],                  // 地址
                    orgContactormobile:[
                        { required: true, message: '联系人电话不能为空', trigger: 'blur' }
                    ],                // 电话
                    email:[
                        { required: true, message: '邮箱不能为空', trigger: 'blur' },
                        { type: 'email', message: '邮箱格式不正确', trigger: 'blur' }
                    ],                 // 邮箱
                    orgUsermobile:[
                        { required: true, message: '手机号不能为空', trigger: 'blur' }
                    ],                   // 手机号
                    userName:[
                        { required: true, message: '用户名不能为空', trigger: 'blur' }
                    ],                    // 用户名
                    userPwd:[
                        { required: true, message: '密码不能为空', trigger: 'blur' }
                    ],                       // 密码
                    maxTenantNo:[
                        { required: true, message: '租户最大数不能为空', trigger: 'blur' }
                    ],                   //  租户最大数
                    status:[
                        { required: true, message: '请选是否有效', trigger: 'change' }
                    ],                            //  是否生效            
                    establishTime:[
                        { required: true, type: 'date', message: '请选择成立日期', trigger: 'change' }
                    ],              // 成立日期
                    lawPerson:[
                        { required: true, message: '法人不能为空', trigger: 'blur' }
                    ],                      // 法人
                    orgCode:[
                        { required: true, message: '三证合一编号不能为空', trigger: 'blur' }
                    ],                       // 三证合一编号
                    orgName:[
                        { required: true, message: '名称不能为空', trigger: 'blur' }
                    ],                    // 名称
                    postCode:[
                        { required: true, message: '邮编不能为空', trigger: 'blur' }
                    ]                    // 邮编            
                },
            }  
        },
        methods: {
            checkname(name,event){
                if(event.target.value != ''){
                    var _this = this;
                    if(name==1){
                        _this.$http.post(`${_this.dmoreurl}/bizAssetPartner/checkUserName`,{userName:event.target.value}).then(res => {
                            if(res.data.code!='200'){
                                _this.$Message.error('名称重复！    请修改！');
                                _this.formValidate.orgName='';
                            }
                        })
                    }else{
                        _this.$http.post(`${_this.dmoreurl}/bizAssetPartner/checkOrgCode`,{orgCode:event.target.value}).then(res => {
                            if(res.data.code!='200'){
                                _this.$Message.error('三证合一编码重复！    请修改！');
                                _this.formValidate.orgCode='';
                            }
                        })
                    }
                }    
            },
            trans_go(){
                this.formValidate1.assetPartner.contractInfo=this.formValidate.contractInfo;
                this.formValidate1.assetPartner.businessLicense=this.formValidate.businessLicense;
                this.formValidate1.assetDeduct.createUser=this.formValidate.createUser;           
                this.formValidate1.assetDeduct.deductRate=this.formValidate.deductRate;                     // 利率
                this.formValidate1.assetDeduct.contractStartDate=new Date(this.formValidate.contractStartDate).getTime();       // 起始日期
                this.formValidate1.assetDeduct.contractEndDate=new Date(this.formValidate.contractEndDate).getTime();          //  结束日期
                this.formValidate1.assetPartner.createUser=this.formValidate.createUser; 
                this.formValidate1.assetPartner.depositAccount=this.formValidate.depositAccount;              // 保证金账户
                this.formValidate1.assetPartner.depositAmount=this.formValidate.depositAmount;                // 保证金总额
                this.formValidate1.assetPartner.depositBank=this.formValidate.depositBank;                  // 保证金银行
                this.formValidate1.assetPartner.drawAccount=this.formValidate.drawAccount;                  // 扣款账户
                this.formValidate1.assetPartner.drawBank=this.formValidate.drawBank;                  // 扣款银行
                this.formValidate1.assetPartner.saveAccount=this.formValidate.saveAccount;                 // 存款账户
                this.formValidate1.assetPartner.saveBank=this.formValidate.saveBank;                     // 存款银行
                this.formValidate1.assetPartner.businessLicense=this.formValidate.businessLicense;                      //营业执照
                this.formValidate1.assetPartner.contractInfo=this.formValidate.contractInfo;                         //合约
                this.formValidate1.orgContactor.contact=this.formValidate.contact;                        // 联系人
                this.formValidate1.orgContactor.createUser=this.formValidate.createUser;                 
                this.formValidate1.orgContactor.address=this.formValidate.address;                  // 地址
                this.formValidate1.orgContactor.mobile=this.formValidate.orgContactormobile;                  // 电话
                this.formValidate1.orgUser.createUser=this.formValidate.createUser;
                this.formValidate1.orgUser.email=this.formValidate.email;                 // 邮箱
                this.formValidate1.orgUser.mobile=this.formValidate.orgUsermobile;                   // 手机号
                this.formValidate1.orgUser.userName=this.formValidate.userName;                    // 用户名
                this.formValidate1.orgUser.userPwd=this.formValidate.userPwd;                       // 密码
                this.formValidate1.saTenant.createUser=this.formValidate.createUser; 
                this.formValidate1.saTenant.maxTenantNo=this.formValidate.maxTenantNo;                   //  租户最大数
                this.formValidate1.saTenant.status=this.formValidate.status;                            //  是否生效 
                this.formValidate1.organization.createUser=this.formValidate.createUser;         
                this.formValidate1.organization.establishTime=new Date(this.formValidate.establishTime).getTime();              // 成立日期
                this.formValidate1.organization.lawPerson=this.formValidate.lawPerson;                      // 法人
                this.formValidate1.organization.orgCode=this.formValidate.orgCode;                       // 三证合一编号
                this.formValidate1.organization.orgName=this.formValidate.orgName;                    // 名称
                this.formValidate1.organization.postCode=this.formValidate.postCode;                   // 邮编
                this.formValidate1.organization.regiestCapital=this.formValidate.regiestCapital;                 // 注册资金
                this.formValidate1.assetDeduct.id=this.formValidate.assetDeduct_id;
                this.formValidate1.assetPartner.assetId=this.formValidate.assetPartner_assetId;
                this.formValidate1.orgContactor.id=this.formValidate.orgContactor_id;
                this.formValidate1.orgUser.userId=this.formValidate.orgUser_userId;
                this.formValidate1.saTenant.tenantId=this.formValidate.saTenant_tenantId;
                this.formValidate1.organization.tenantId=this.formValidate.organization_tenantId;
            },
            trans_back(){
                this.formValidate.contractInfo=this.form.assetPartner.contractInfo;
                this.formValidate.businessLicense=this.form.assetPartner.businessLicense;
                this.formValidate.createUser=this.form.assetDeduct.createUser;           
                this.formValidate.deductRate=this.form.assetDeduct.deductRate.toString();                     // 利率
                this.formValidate.contractStartDate=new Date(this.form.assetDeduct.contractStartDate);       // 起始日期
                this.formValidate.contractEndDate=new Date(this.form.assetDeduct.contractEndDate);          //  结束日期
                this.formValidate.depositAccount=this.form.assetPartner.depositAccount;              // 保证金账户
                this.formValidate.depositAmount=this.form.assetPartner.depositAmount.toString();                // 保证金总额
                this.formValidate.depositBank=this.form.assetPartner.depositBank;                  // 保证金银行
                this.formValidate.drawAccount=this.form.assetPartner.drawAccount;                  // 扣款账户
                this.formValidate.drawBank=this.form.assetPartner.drawBank;                  // 扣款银行
                this.formValidate.saveAccount=this.form.assetPartner.saveAccount;                 // 存款账户
                this.formValidate.saveBank=this.form.assetPartner.saveBank;                     // 存款银行
                this.formValidate.businessLicense=this.form.assetPartner.businessLicense;                      //营业执照
                this.formValidate.contractInfo=this.form.assetPartner.contractInfo;                         //合约
                this.formValidate.contact=this.form.orgContactor.contact;                        // 联系人                
                this.formValidate.address=this.form.orgContactor.address;                  // 地址
                this.formValidate.orgContactormobile=this.form.orgContactor.mobile;                  // 电话
                this.formValidate.email=this.form.orgUser.email;                 // 邮箱
                this.formValidate.orgUsermobile=this.form.orgUser.mobile;                   // 手机号
                this.formValidate.userName=this.form.orgUser.userName;                    // 用户名
                this.formValidate.userPwd=this.form.orgUser.userPwd;                       // 密码
                this.formValidate.maxTenantNo=this.form.saTenant.maxTenantNo.toString();                   //  租户最大数
                this.formValidate.status=this.form.saTenant.status;                            //  是否生效           
                this.formValidate.establishTime=new Date(this.form.establishTime);              // 成立日期
                this.formValidate.lawPerson=this.form.lawPerson;                      // 法人
                this.formValidate.orgCode=this.form.orgCode;                       // 三证合一编号
                this.formValidate.orgName=this.form.orgName;                    // 名称
                this.formValidate.postCode=this.form.postCode;                   // 邮编
                this.formValidate.regiestCapital=this.form.regiestCapital.toString();  
                this.formValidate.assetDeduct_id=this.form.assetDeduct.id;
                this.formValidate.assetPartner_assetId=this.form.assetPartner.assetId;
                this.formValidate.orgContactor_id=this.form.orgContactor.id;
                this.formValidate.orgUser_userId=this.form.orgUser.userId;
                this.formValidate.saTenant_tenantId=this.form.saTenant.tenantId;
                this.formValidate.organization_tenantId=this.form.tenantId;
            },
            handleView () {  
                this.src=this.formValidate.businessLicense;
                this.visible = true;
            },
            handleSubmit_zc(name) { 
                this.trans_go();
                var _this = this;
                var submitUrl, submitMethods;
                if (this.form != null) {
                    submitUrl = `${_this.dmoreurl}/bizAssetPartner/partnerModify`;
                    submitMethods = 'POST';
                } else { 
                    submitUrl = `${_this.dmoreurl}/bizAssetPartner/partnerAdd`;
                    submitMethods = 'POST';
                }
                if(this.formValidate1.assetPartner.businessLicense == ''){
                        this.$Message.error('请上传营业执照!');
                        return false;
                };
                if(this.formValidate1.assetPartner.contractInfo == ''){
                        this.$Message.error('请上传合约信息!');
                        return false;
                };
                _this.$refs[name].validate((valid) => {
                    if (valid) {     
                        _this.$http({
                                url: submitUrl,
                                method: submitMethods,
                                data: _this.formValidate1
                            })
                            .then(function(response) {
                                if(response.data){
                                _this.$Message.success('提交成功!');
                                _this.$refs[name].resetFields();
                                Object.assign(_this.$data.formValidate, _this.$options.data().formValidate); // 让我们的数据恢复到初始化状态 
                                _this.$router.push({path: '/test4'});

                                }else{
                                    _this.$Message.success('用户名重复！    请修改！');
                                }  
                            });
                    } else {
                        this.$Message.error('表单验证失败!');
                    }
                });
            },
            handleSuccess(response) {
                this.formValidate.businessLicense=response.data.businessLicense;
                this.up1='营业执照';
                this.$Message.success('上传成功!');
                this.$refs.upload.clearFiles();
                this.disabled1=true;
                this.disabled4=false;
            },
            handleSuccess1(response) {
                this.formValidate.contractInfo=response.data.contractInfo;
                this.up2='合约信息';
                this.$Message.success('上传成功!');
                this.$refs.upload1.clearFiles();
                this.disabled2=true;
                this.disabled5=false;
            },
            handleFormatError(file) {
                this.$Notice.warning({
                title: '文件格式不正确',
                desc: '文件 ' + file.name + ' 格式不正确，请上传 jpg 或 png 格式的图片。'
                });
            },
            handleMaxSize(file) {
                this.$Notice.warning({
                title: '超出文件大小限制',
                desc: '文件 ' + file.name + ' 太大，不能超过 2M。'
                });
            },
            remove_zc(index,i) {
                var _this = this;
                // this.$Modal.confirm({
                //     title: '确认删除数据',
                //     content: '<p>确认删除数据</p>',
                //     onOk: () => {
                //         let deleteUrl = `http://localhost:3000/${_this.module}/`+index;
                //         _this.$http.delete(deleteUrl)
                //             .then(response => {
                //                  _this.getData_zc();
                //                 if(i==1){
                //                     _this.up1='— —';
                //                     _this.disabled1=false;
                //                     _this.disabled4=true;
                //                 }
                //                 if(i==2){
                //                     _this.up2='— —';
                //                     _this.disabled2=false;
                //                     _this.disabled5=true;
                //                 }
                //                 if(i==3){
                //                     _this.up3='— —';
                //                     _this.disabled3=false;
                //                     _this.disabled6=true;
                //                 }
                //                 this.$Message.info('成功删除数据');
                //             })
                //     },
                //     onCancel: () => {
                //         this.$Message.info('取消删除数据');
                //     }
                // });

            }
        },
        computed:{
            ...mapGetters(['form']),
            ...mapGetters(['zc_form']),
            ...mapGetters(['zc_formshow']),
            postUrl1(){
                return `${this.dmoreurl}/bizAssetPartner/saveBusinessLicense`
            },
            postUrl2(){
                return `${this.dmoreurl}/bizAssetPartner/saveContractInfo`
            }
        },
        mounted () {
            this.uploadList = this.$refs.upload.fileList;
            this.uploadList1 = this.$refs.upload1.fileList;
        },
        created() {
            this.formValidate.saTenant_tenantId=this.filter.tenantId;
            this.formValidate.organization_tenantId=this.filter.tenantId;
            this.formValidate.createUser=this.filter.createUser;
            console.log(this.form)
            if(this.form == null){
                this.disabled=false;
                this.disabled_orgcode=false;
            }else{
                this.trans_back();
                this.up1='营业执照';
                this.disabled1=true;
                this.disabled4=false;
                this.up2='合约信息';
                this.disabled2=true;
                this.disabled5=false; 
                this.disabled_orgcode=true;
            }
            if(this.zc_form == false){
                this.$router.push({path: '/test4'});
            }
            if(this.zc_formshow == true && this.form != null){
                this.disabled=true;
                this.disabled_orgcode=true;
            }
        }
    }
</script>
<style lang="scss" >
    .ivu-input[disabled]{
        color:black;
    }
    .ivu-select-disabled .ivu-select-selection{
        color:black;
    }
    .hcgc{
        font-size: 18px;
        position: relative;
        width: 170px;
        top: -6px;
        left: -16px;
        line-height: 40px;
    }
    #serch1_9{
        width: 170px;
        height: 40px;
        border-radius: 4px;
        background:#5b8cff;
        font-family: "microsoft yahei";
        font-size: 18px;
        font-weight: 500;
        cursor: pointer;
        text-align: center;
        color:#ffffff;
        letter-spacing: 1px;
        box-shadow: 0px 3px 1px rgba(91, 140, 255, 0.3);
    }
    #serch1_9:hover{
        background:#6896ff;
    }
    .title_5{
        width:100%;
        height:60px;
        border-bottom:1px solid #dbe3f3;
    }
    .ivu-picker-panel-body{
        width: 240px;
    }
    .ivu-picker-panel-content{
        padding-left: 11px;
    }
    #cancel1{
        width: 170px;
        height: 40px;
        border-radius: 4px;
        border:none;
        background:#aab0c0;
        font-family: "microsoft yahei";
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        text-align: center;
        color:#ffffff;
        letter-spacing: 1px;
        box-shadow: 0px 3px 1px rgba(170,176,191, 0.3);
    }
    #cancel1:hover{
        background:#aab0c0;
    }
    .tijiao{
        text-align: center;
        padding-top: 30px;
        border-top:1px solid #dbe3f3;
        height:100px;
    }
    .uptabc{
        color:#848996;
        font-size: 14px;
        float:left;
        display: block;
        height: 40px;
        line-height: 40px;
    }
    .uptab{
        padding: 0px 35px 0px 35px;
        height:40px;
        background: #f6f8fc;
        border: 1px solid #dbe3f3;
    }
    .uptab1{
        display:inline-block;
        padding: 0px 0px 0px 35px;
        height:40px;
    }
    .uptab2{
        display:inline-block;
        padding: 0px 0px 0px 35px;
        height:40px;
        background: #fafcff;
    }
    .sost4{
        display: inline-block;
        width: 320px;
        margin-bottom: 15px;
    }
    .sost5{
        display: inline-block;
        width: 348px;
        float: left;
    }
    .sost5_5{
        display: inline-block;
        width: 245px;
        float: left;
    }
    .sosuo2{
        padding: 20px 0px 20px 30px;
        border-bottom: 1px solid #dbe3f3;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .sosuo2_6{
        padding: 20px 0px 0px 0px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .sosuo5{
        padding: 20px 0px 20px 30px;
        border-bottom: 1px solid #dbe3f3;
        display: flex;
        flex-wrap: wrap;
    }
</style>